Some tests for Udon performance. these tests where done 1000 times for every element on a 1024 long byte array or 1024000 iterations.
These where done on an Ryzen 5800X with quite a lot open in the background.
Set Local ╢█████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟ 292.63ms
Set Other ╢██████████████████████████████████████████████████╟ 689.77ms
Setting on the remote object is 2.36 times slower
Set Local Long Name ╢████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟ 291.61ms
Set Other Long Name ╢██████████████████████████████████████████████████╟ 732.08ms
Having long variable names doesn't seem to effect setting variables locally, but seems to be about 6% slower on a variable name of 103chars compared to one of 8chars.
Read Local ╢████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟ 297.02ms
Read Other ╢████████████████████████████████████████████████░░╟ 693.22ms
╢ ╟
Read Local Long Name ╢████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟ 295.57ms
Read Other Long Name ╢██████████████████████████████████████████████████╟ 727.74ms
Reading seems to be about as fast as writing.
Read Local ╢████████████████████████████████████████████████░░╟ 297.02ms
Read Other Cached ╢██████████████████████████████████████████████████╟ 309.35ms
If I cache the byte array it's just as fast as reading from a local variable. I believe every time you access that array it has to copy that whole array over. so just cache it if you're accessing an array a lot without editing it.
Didn't bother to test this with caching writing, but I imagine it's the same.